﻿using System;
using System.Collections.Generic;
using IterationLife.System.Models;
using Util.Domains.Repositories;

namespace IterationLife.System.Repositories {
    /// <summary>
    /// 用户仓储
    /// </summary>
    public interface IUserRepository : IRepository<User> {
        /// <summary>
        /// 获取启用用户集合
        /// </summary>
        List<User> GetEnabledList();
        /// <summary>
        /// 获取用户编号
        /// </summary>
        /// <param name="userName">用户名</param>
        Guid GetUserId( string userName );
        /// <summary>
        /// 是否用户名已存在
        /// </summary>
        /// <param name="userName">用户名</param>
        bool IsUserNameExisted( string userName );
        /// <summary>
        /// 是否用户名已存在
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="id">用户编号</param>
        bool IsUserNameExisted( string userName, Guid id );
        /// <summary>
        /// 是否手机号已存在
        /// </summary>
        /// <param name="phoneNumber">手机号</param>
        bool IsPhoneNumberExisted(string phoneNumber);
        /// <summary>
        /// 是否手机号已存在
        /// </summary>
        /// <param name="phoneNumber">手机号</param>
        /// <param name="id">用户编号</param>
        bool IsPhoneNumberExisted(string phoneNumber, Guid id);
        /// <summary>
        /// 是否邮箱已存在
        /// </summary>
        /// <param name="email">邮箱</param>
        bool IsEmailExisted(string email);
        /// <summary>
        /// 是否邮箱已存在
        /// </summary>
        /// <param name="email">邮箱</param>
        /// <param name="id">用户编号</param>
        bool IsEmailExisted(string email, Guid id);
    }
}
